/*
* Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <stdio.h>

#define RGB_CLEAR() printf("\033[0m");
#define RGB(rgb) printf("\033[38;2;%d;%d;%dm", rgb >> 16 & 0xFF, rgb >> 8 & 0xFF, rgb & 0xFF);

#define OHMW_LOGE(fmt, ...)                 \
    RGB(0xC93A4E);                          \
    printf("[E] " fmt "\n", ##__VA_ARGS__); \
    RGB_CLEAR();

#define OHMW_LOGW(fmt, ...)                 \
    RGB(0x2E7DD5);                          \
    printf("[W] " fmt "\n", ##__VA_ARGS__); \
    RGB_CLEAR();

#define OHMW_LOGI(fmt, ...)                 \
    RGB(0x6BA121);                          \
    printf("[I] " fmt "\n", ##__VA_ARGS__); \
    RGB_CLEAR();
